import loading from '@/components/loading'
export default {
  data () {
    return {
      resmes: {username: '', userpas:''},
    }
  },
  components:{
    loading
  },
  methods: {
    route(path){
      this.$router.push(path)
    },
    gotologin:function() {
      //this.$router.push({path:'mysystem'});
      //console.log("gogogo");
      var loginname=this.resmes.username;
      var loginpas=this.resmes.userpas;
      let self=this;
      this.$http.post(
        "/api/login",
        {
          username:loginname,
        })
        .then(function (res) {
          //console.log(res.data.data[0].userpas);
          console.log("请求成功");
          console.log(res);
          if(loginpas === res.data.data[0].userpas){
            alert("登录成功");
            self.$router.push("/blank");
            self.$store.state.loginmes='已登录';
            //console.log(self.$store.state.loginmes);
            //console.log(res);
          }
        })
        .catch(function (err) {
          console.log(err);
          alert("登录失败")
        });
    },
    gotores:function(){
      this.$router.replace({path:'/home/frontres'})
    }
  },
}
